import SMERouter from 'sme-router';
import adminList from "@/views/adminList";
import advList from "@v/advList";
import login from "./views/login.ejs";
import index from "./views/index.ejs";
import Navbar from "./components/Navbar.ejs";
import Siderbar from "./components/Sidebar.ejs";
import Content from "./components/Content.ejs";
import Footer from "./components/Footer.ejs";
import adminListC from "./controllers/adminList";
import advListC from "./controllers/advList";
import loginC from "./controllers/login";
import indexC from "./controllers/index";
window.router = new SMERouter('root',"html5");
router.route("/index",indexC())
// 请求地址为/index/adminList，呈现的内容为：管理员界面
router.route("/index/adminList",adminListC())
// 请求地址为/index/advList，呈现的内容为：广告界面
router.route("/index/advList",advListC())
router.route("/login",loginC())
// 找不到匹配的路由地址，重定向至/index/adminList
router.route('*', (req, res, next) => {
	res.redirect('/index/adminList')
})